package com.boluo.common.utils;

import org.springframework.util.StringUtils;

import java.math.BigDecimal;
import java.util.Objects;

/**
 * @Author boluo
 * @Date 2023/4/11 14:37
 * @注释
 */
public abstract class BigDecimalUtils {
    private static final int NUMBER_ZERO = 0;

    public static boolean isBigZero(BigDecimal num) {
        if (Objects.isNull(num)){
            return false;
        }

        return num.compareTo(new BigDecimal(NUMBER_ZERO+"")) >= NUMBER_ZERO;
    }

    public static void main(String[] args) {
        System.out.println(isBigZero(new BigDecimal("0")));//true
        System.out.println(isBigZero(null));// false
        System.out.println(isBigZero(new BigDecimal("-10")));//false
        System.out.println(isBigZero(new BigDecimal("10")));//true
    }
}
